import http from "@/utils/http";

export function getUserList(values = { params: {} }) {
  return http.post("/system/user/list", values);
}

export function getUser(userId) {
  return http.get(`/system/user/detail/${userId}`);
}

export function addUser(params) {
  return http.post("/system/user/insert", params);
}

export function updateUser(params) {
  return http.post("/system/user/update", params);
}

export function updateUserStatus(params) {
  return http.post("/system/user/update/status", params);
}

export function deleteUser(userId) {
  return http.post("/system/user/delete", userId, {
    headers: {
      "content-type": "application/json",
    },
  });
}

export function deleteBatchUser(userIds) {
  return http.post("/system/user/deleteBatch", userIds);
}

export function getExportParams() {
  return http.get("/system/user/export/params");
}

export function exportUser(params = {}) {
  return http.post("/system/user/export", params, {
    responseType: "blob",
  });
}
